Skip to content

Fix arrow function parens arguments #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

dodev
Copy link

@dodev dodev commented Apr 14, 2016

The syntax highlighter showed error when arrow functions had parentheses surrounding their arugemnts:

...
  .then((result) => {
      send(result);
  })
--^ // The last parenthesis of `then` method call was considered excess.

I fixed the regex for args in parenthesis and it seems it works. I'm using it right now.

As seen in #374 :)

@amadeus
Copy link
Collaborator

amadeus commented Apr 14, 2016

So, unfortunately, technically this doesn't work. It may appear to work based on your syntax highlighting, however it actually completely breaks the matching of jsArrowFuncArgs. In other words, it's the same as as just removing that entire match group completely.

I have been doing a lot of research into this, and it's actually a quite difficult problem to solve. On potential solution may be to remove the jsArrowFuncArgs highlight group completely until I can figure out a solution that works. I've tested a bunch of other JS syntax plugins, including even in other editors, and nobody can get it right for all scenarios, it's a real clusterfuck.

@dodev
Copy link
Author

dodev commented Apr 15, 2016

TBH, I don't understand the regex syntax in viml and I thought it was a typo, a missing closing bracket. I hope somebody finds a solution. Unfortunately, I don't have enough free time to look into this issue.

@dodev dodev closed this Apr 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants